package cn.kgc.entity;

import java.util.Date;
import java.io.Serializable;

import cn.kgc.commons.annotation.Dict;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * spu信息(PmsSpuInfo)表实体类
 *
 * @author makejava
 * @since 2022-12-05 09:38:38
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "pms_spu_info")
@SuppressWarnings("serial")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class PmsSpuInfo extends Model<PmsSpuInfo> implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id; //主键


    /**
     * 商品名称
     **/
    @TableField(value = "spu_name")
    private String spuName;


    /**
     * 商品描述
     **/
    @TableField(value = "spu_description")
    private String spuDescription;


    /**
     * 所属分类id
     **/
    @TableField(value = "catalog_id")
    private Long catalogId;


    /**
     * 品牌id
     **/
    @TableField(value = "brand_id")
    private Long brandId;


    @TableField(value = "weight")
    private Double weight;


    /**
     * 上架状态[0 - 下架，1 - 上架]
     **/
    @Dict(dictCode = "publish_status")
    @TableField(value = "publish_status")
    private Short publishStatus;


    @TableLogic
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    private int deleted;  //逻辑删除标志


    @TableField(value = "creationdate", fill = FieldFill.INSERT)
    @JsonIgnore
    private Date creationdate; //创建时间


    @TableField(value = "modifydate", fill = FieldFill.UPDATE)
    @JsonIgnore
    private Date modifydate; //修改时间


    @Version
    private int version;   //版本

    @TableField(exist=false)
    private String brandName;  //品牌的名字

    @TableField(exist=false)
    private String catalogName; //分类的名字

}
